@extends('admin.layout.common')
@section('content')
    <link rel="stylesheet" type="text/css" href="{{asset('/css/user/DetailedInformation.css')}}">
    <div class="content_box">
        <div class="content">
            <div class="mon">
                <div class="mon_left">
                    <p>
                        <i class="iconfont icon gongzuo">&#xe647;</i>
                        <span>{{date('Y年m月d日')}}  本月已开户{{ session('monthPass') }}个  打回{{session('monthRefuse')}}个</span>
                    <p>超过了{{ session('monthPrecent') }}的三咖审核员，继续努力！从此踏上人生巅峰，迎娶白富美！</p>
                    </p>
                </div>
                <div class="mon_right">
                    <p>您今天已经开户{{session('todayPass')}}个    打回{{session('todayRefuse')}}个</p>
                    <p>超过了{{session('todayPrecent')}}的三咖开户员哦~棒棒哒！！！</p>
                </div>
            </div>
            <p class="tongzhi"><i class="iconfont icon laba">&#xe914;</i>{{getArticleByDepartmentId()}}</p>
            <!-- 公共结束 -->
        </div>
        <div class="detailed">
            <h1 class="h1">用户详细信息<i class="icon iconfont xieru" id="{{$user['id']}}">&#x545;</i></h1>
            @if ($user['type'] == 1)
            <div class="hide_box">
                <div class="top_box" style="text-align: left">
                    <div class="dl_left_box">
                        <dl>
                            <dd>
                                <h2>姓名：<span>{{$user['real_name']}}</span></h2>gitgit
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>用户ID：</span>
                                <span>{{$user['id']}}</span>
                            </dd>
                            <dd>
                                <span>状态：</span>
                                <span>{{$user['status']}}</span>
                            </dd>
                            <dd>
                                <span>艺名：</span>
                                <span>{{$user['stage_name']}}</span>
                            </dd>
                            <dd>
                                <span>手机号：</span>
                                <span>{{$user['phone']}}</span>
                            </dd>
                            <dd>
                                <span>邮箱：</span>
                                <span>{{$user['email']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约时间：</span>
                                <span>2018-05-02-Z01</span>
                                <span style="color:#CF2121;cursor:pointer;"><a href="http://{{$_SERVER['HTTP_HOST'].$user['agreement']}}" download="协议">查看协议</a></span>
                            </dd>
                            <dd>
                                <span>到期时间：</span>
                                <span>2019-01-0-1</span>
                                <button type="button" class="add btn" id="{{$user['id']}}">更新协议</button>
                                <button type="button" class="termination btn" onclick="termination(<?php echo e($user['id']); ?>)">终止协议</button>
                        </dl>
                        <dl>
                            <dd>
                                <span>收款人姓名：</span>
                                <span>{{$user['payee_name']}}</span>
                            </dd>
                            <dd>
                                <span>银行卡卡号：</span>
                                <span>{{$user['band_card']}}</span>
                            </dd>
                            <dd>
                                <span>开户行：</span>
                                <span>{{$user['band_info']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>备注：</span>
                                <span>{{$user['remark']}}</span>
                            </dd>
                        </dl>
                    </div>
                    <div class="dl_right_box">
                        <dl>
                            <dd>&nbsp;</dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>地区：</span>
                                <span>{{$user['country']}}</span>
                            </dd>
                            <dd>
                                <span>省份：</span>
                                <span>{{$user['provice']}}</span>
                            </dd>
                            <dd>
                                <span>期望联系时间：</span>
                                <span>{{$user['phone_time_text']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约负责人：</span>
                                <span>{{$user['signing_leader']}}</span>
                            </dd>
                            <dd>
                                <span>百科：</span>
                                <span>{{$user['baidu']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>电话素质：</span>
                                <span>{{$user['phone_quality']}}</span>
                            </dd>
                            <dd>
                                <span>主诉要求：</span>
                                <span>{{$user['request']}}</span>
                            </dd>
                            <dd>
                                <span>计算机能力：</span>
                                <span>{{$user['computer_capacity']}}</span>
                            </dd>
                            <dd>
                                <span>用户来源：</span>
                                <span>{{$user['come_from']}}</span>
                            </dd>
                        </dl>
                    </div>
                </div>
                @if($user['call_record'])
                <table>
                    <tr>
                        <th>开始呼叫时间</th>
                        <th>呼叫结束时间</th>
                        <th>被呼叫号码</th>
                        <th>通话时长</th>
                        <th>接听状态</th>
                        <th>录音文件下载</th>
                    </tr>
                        @foreach($user['call_record'] as $v)
                    <tr>
                        <td>{{$v['startTime']}}</td>
                        <td>{{$v['endTime']}}</td>
                        <td>{{$v['calledid']}}</td>
                        <td>{{$v['duration']}}</td>
                        {{---3 => '系统平台错误', -2 => '被叫电话不应答', -1 => '主叫主动挂机', 1 => '接通'--}}
                        <td>
                            @switch($v['recStatus'])
                                @case(-3)
                                系统平台错误
                                @break
                                @case(-2)
                                被叫电话不应答
                                @break
                                @case(-1)
                                主叫主动挂机
                                @break
                                @case(1)
                                接通
                                @break
                                @default
                                其他
                                @break
                            @endswitch
                        </td>
                        <td><a href="{{url($v['localRecordUrl'])}}">下载文件</a></td>
                    </tr>
                        @endforeach

                </table>
                @endif
                @if ($user['deal'] != [])
                    <p style=" text-align: left;margin-top:40px;">
                        <span class="qianyue">违规记录：</span><br>
                        @foreach ($user['deal'] as $record)
                            <span>{{$record['create_at']}} @if($record['deal_type'] != 100)停{{$record['deal_type']}}天 @else 永久停用 @endif 备注：{{$record['remark']}}</span><br>
                        @endforeach
                    </p>
                @endif
                <button type="button" class="btn_click" onclick=userRenew({{$user['id']}})>恢复账号</button>
                <button type="button" class="chuli btn_click" id="{{$user['id']}}">违约处理</button>
                <button type="button" onclick="termination(<?php echo e($user['id']); ?>)" class="zhuxiao btn_click">注销用户</button>
            </div>
            @elseif ($user['type'] == 2)
            <div class="hide_box">
                <div class="top_box" style="text-align: left">
                    <div class="dl_left_box">
                        <dl>
                            <dd>
                                <h2>团体名：<span>{{$user['team']}}</span></h2>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>用户ID：</span>
                                <span>{{$user['id']}}</span>
                            </dd>
                            <dd>
                                <span>状态：</span>
                                <span>{{$user['status']}}</span>
                            </dd>
                            <dd>
                                <span>联系人：</span>
                                <span>{{$user['phone_name']}}</span>
                            </dd>
                            <dd>
                                <span>艺名：</span>
                                <span>{{$user['phone_stage']}}</span>
                            </dd>
                            <dd>
                                <span>手机号：</span>
                                <span>{{$user['phone']}}</span>
                            </dd>
                            <dd>
                                <span>邮箱：</span>
                                <span>{{$user['email']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约时间：</span>
                                <span>2018-05-02-Z01</span>
                                <span style="color:#CF2121;cursor:pointer;"><a href="http://{{$_SERVER['HTTP_HOST'].$user['agreement']}}" download="协议">查看协议</a></span>
                            </dd>
                            <dd>
                                <span>到期时间：</span>
                                <span>2019-01-0-1</span>
                                <button type="button" class="add btn" id="{{$user['id']}}">更新协议</button>
                                <button type="button" class="termination btn" onclick="termination(<?php echo e($user['id']); ?>)">终止协议</button>
                        </dl>
                        <dl>
                            <dd>
                                <span>收款人姓名：</span>
                                <span>{{$user['payee_name']}}</span>
                            </dd>
                            <dd>
                                <span>银行卡卡号：</span>
                                <span>{{$user['band_card']}}</span>
                            </dd>
                            <dd>
                                <span>开户行：</span>
                                <span>{{$user['band_info']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>备注：</span>
                                <span>{{$user['remark']}}</span>
                            </dd>
                        </dl>
                    </div>
                    <div class="dl_right_box">
                        <dl>
                            <dd>&nbsp;</dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>地区：</span>
                                <span>{{$user['country']}}</span>
                            </dd>
                            <dd>
                                <span>省份：</span>
                                <span>{{$user['provice']}}</span>
                            </dd>
                            <dd>
                                <span>期望联系时间：</span>
                                <span>{{$user['phone_time_text']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约负责人：</span>
                                <span>{{$user['signing_leader']}}</span>
                            </dd>
                            <dd>
                                <span>百科：</span>
                                <span>{{$user['baidu']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>电话素质：</span>
                                <span>{{$user['phone_quality']}}</span>
                            </dd>
                            <dd>
                                <span>主诉要求：</span>
                                <span>{{$user['request']}}</span>
                            </dd>
                            <dd>
                                <span>计算机能力：</span>
                                <span>{{$user['computer_capacity']}}</span>
                            </dd>
                            <dd>
                                <span>用户来源：</span>
                                <span>{{$user['come_from']}}</span>
                            </dd>
                        </dl>
                    </div>
                </div>
                <table>
                    <tr>
                        <th>状态</th>
                        <th>开始呼叫时间</th>
                        <th>呼叫结束时间</th>
                        <th>被呼叫号码</th>
                        <th>通话时长</th>
                        <th>接听状态</th>
                        <th>录音文件下载</th>
                    </tr>
                    <tr>
                        <td>失败</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>131321</td>
                        <td>被叫电话不应答</td>
                        <td>下载文件</td>
                    </tr>
                    <tr>
                        <td>成功</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>131321</td>
                        <td>接通</td>
                        <td>下载文件</td>
                    </tr>
                </table>
                @if ($user['deal'] != [])
                    <p style=" text-align: left;margin-top:40px;">
                        <span class="qianyue">违规记录：</span><br>
                        @foreach ($user['deal'] as $record)
                            <span>{{$record['create_at']}} @if($record['deal_type'] != 100)停{{$record['deal_type']}}天 @else 永久停用 @endif 备注：{{$record['remark']}}</span><br>
                        @endforeach
                    </p>
                @endif
                <button type="button" class="btn_click" onclick=userRenew({{$user['id']}})>恢复账号</button>
                <button type="button" class="chuli btn_click" id="{{$user['id']}}">违约处理</button>
                <button type="button" onclick="termination(<?php echo e($user['id']); ?>)" class="zhuxiao btn_click">注销用户</button>
            </div>
            @elseif ($user['type'] == 3)
            <div class="hide_box">
                <div class="top_box" style="text-align: left">
                    <div class="dl_left_box">
                        <dl>
                            <dd>
                                <h2>经纪人：<span>{{$user['real_name']}}</span></h2>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>用户ID：</span>
                                <span>{{$user['id']}}</span>
                            </dd>
                            <dd>
                                <span>状态：</span>
                                <span>{{$user['status']}}</span>
                            </dd>
                            <dd>
                                <span>联系人：</span>
                                <span>{{$user['phone_name']}}</span>
                            </dd>
                            <dd>
                                <span>主营经营：</span>
                                <span>{{$user['operate_text']}}</span>
                            </dd>
                            <dd>
                                <span>手机号：</span>
                                <span>{{$user['phone']}}</span>
                            </dd>
                            <dd>
                                <span>邮箱：</span>
                                <span>{{$user['email']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约时间：</span>
                                <span>2018-05-02-Z01</span>
                                <span style="color:#CF2121;cursor:pointer;"><a href="http://{{$_SERVER['HTTP_HOST'].$user['agreement']}}" download="协议">查看协议</a></span>
                            </dd>
                            <dd>
                                <span>到期时间：</span>
                                <span>2019-01-0-1</span>
                                <button type="button" class="add btn" id="{{$user['id']}}">更新协议</button>
                                <button type="button" class="termination btn" onclick="termination(<?php echo e($user['id']); ?>)">终止协议</button>
                        </dl>
                        <dl>
                            <dd>
                                <span>收款人姓名：</span>
                                <span>{{$user['payee_name']}}</span>
                            </dd>
                            <dd>
                                <span>银行卡卡号：</span>
                                <span>{{$user['band_card']}}</span>
                            </dd>
                            <dd>
                                <span>开户行：</span>
                                <span>{{$user['band_info']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>备注：</span>
                                <span>{{$user['remark']}}</span>
                            </dd>
                        </dl>
                    </div>
                    <div class="dl_right_box">
                        <dl>
                            <dd>&nbsp;</dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>地区：</span>
                                <span>{{$user['country']}}</span>
                            </dd>
                            <dd>
                                <span>省份：</span>
                                <span>{{$user['provice']}}</span>
                            </dd>
                            <dd>
                                <span>期望联系时间：</span>
                                <span>{{$user['phone_time_text']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约负责人：</span>
                                <span>{{$user['signing_leader']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>电话素质：</span>
                                <span>{{$user['phone_quality']}}</span>
                            </dd>
                            <dd>
                                <span>主诉要求：</span>
                                <span>{{$user['request']}}</span>
                            </dd>
                            <dd>
                                <span>计算机能力：</span>
                                <span>{{$user['computer_capacity']}}</span>
                            </dd>
                            <dd>
                                <span>用户来源：</span>
                                <span>{{$user['come_from']}}</span>
                            </dd>
                        </dl>
                    </div>
                </div>
                <table>
                    <tr>
                        <th>状态</th>
                        <th>开始呼叫时间</th>
                        <th>呼叫结束时间</th>
                        <th>被呼叫号码</th>
                        <th>通话时长</th>
                        <th>接听状态</th>
                        <th>录音文件下载</th>
                    </tr>
                    <tr>
                        <td>失败</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>131321</td>
                        <td>被叫电话不应答</td>
                        <td>下载文件</td>
                    </tr>
                    <tr>
                        <td>成功</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>131321</td>
                        <td>接通</td>
                        <td>下载文件</td>
                    </tr>
                </table>
                @if ($user['deal'] != [])
                    <p style=" text-align: left;margin-top:40px;">
                        <span class="qianyue">违规记录：</span><br>
                        @foreach ($user['deal'] as $record)
                            <span>{{$record['create_at']}} @if($record['deal_type'] != 100)停{{$record['deal_type']}}天 @else 永久停用 @endif 备注：{{$record['remark']}}</span><br>
                        @endforeach
                    </p>
                @endif
                <button type="button" class="btn_click" onclick=userRenew({{$user['id']}})>恢复账号</button>
                <button type="button" class="chuli btn_click" id="{{$user['id']}}">违约处理</button>
                <button type="button" onclick="termination(<?php echo e($user['id']); ?>)" class="zhuxiao btn_click">注销用户</button>
            </div>
            @elseif ($user['type'] == 4)
            <div class="hide_box">
                <div class="top_box" style="text-align: left">
                    <div class="dl_left_box">
                        <dl>
                            <dd>
                                <h2>公司/厂牌名：<span>{{$user['team']}}</span></h2>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>用户ID：</span>
                                <span>{{$user['id']}}</span>
                            </dd>
                            <dd>
                                <span>状态：</span>
                                <span>{{$user['status']}}</span>
                            </dd>
                            <dd>
                                <span>联系人：</span>
                                <span>{{$user['phone_name']}}</span>
                            </dd>
                            <dd>
                                <span>职位：</span>
                                <span>{{$user['business']}}</span>
                            </dd>
                            <dd>
                                <span>手机号：</span>
                                <span>{{$user['phone']}}</span>
                            </dd>
                            <dd>
                                <span>邮箱：</span>
                                <span>{{$user['email']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约时间：</span>
                                <span>2018-05-02-Z01</span>
                                <span style="color:#CF2121;cursor:pointer;"><a href="http://{{$_SERVER['HTTP_HOST'].$user['agreement']}}" download="协议">查看协议</a></span>
                            </dd>
                            <dd>
                                <span>到期时间：</span>
                                <span>2019-01-0-1</span>
                                <button type="button" class="add btn" id="{{$user['id']}}">更新协议</button>
                                <button type="button" class="termination btn" onclick="termination(<?php echo e($user['id']); ?>)">终止协议</button>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>社会统一编码：</span>
                                <span>{{$user['society_code']}}</span>
                            </dd>
                            <dd>
                                <span>营业执照：</span>
                                <span class="license" style="color:#CF2121;cursor:pointer;" photo="{{$user['business_license']}}">查看</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>收款人姓名：</span>
                                <span>{{$user['payee_name']}}</span>
                            </dd>
                            <dd>
                                <span>银行卡卡号：</span>
                                <span>{{$user['band_card']}}</span>
                            </dd>
                            <dd>
                                <span>开户行：</span>
                                <span>{{$user['band_info']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>备注：</span>
                                <span>{{$user['remark']}}</span>
                            </dd>
                        </dl>
                    </div>
                    <div class="dl_right_box">
                        <dl>
                            <dd>&nbsp;</dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>地区：</span>
                                <span>{{$user['country']}}</span>
                            </dd>
                            <dd>
                                <span>省份：</span>
                                <span>{{$user['provice']}}</span>
                            </dd>
                            <dd>
                                <span>期望联系时间：</span>
                                <span>{{$user['phone_time_text']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>签约负责人：</span>
                                <span>{{$user['signing_leader']}}</span>
                            </dd>
                            <dd>
                                <span>百科：</span>
                                <span>{{$user['baidu']}}</span>
                            </dd>
                        </dl>
                        <dl>
                            <dd>
                                <span>电话素质：</span>
                                <span>{{$user['phone_quality']}}</span>
                            </dd>
                            <dd>
                                <span>主诉要求：</span>
                                <span>{{$user['request']}}</span>
                            </dd>
                            <dd>
                                <span>计算机能力：</span>
                                <span>{{$user['computer_capacity']}}</span>
                            </dd>
                            <dd>
                                <span>用户来源：</span>
                                <span>{{$user['come_from']}}</span>
                            </dd>
                        </dl>
                    </div>
                </div>
                <table>
                    <tr>
                        <th>状态</th>
                        <th>开始呼叫时间</th>
                        <th>呼叫结束时间</th>
                        <th>被呼叫号码</th>
                        <th>通话时长</th>
                        <th>接听状态</th>
                        <th>录音文件下载</th>
                    </tr>
                    <tr>
                        <td>失败</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>131321</td>
                        <td>被叫电话不应答</td>
                        <td>下载文件</td>
                    </tr>
                    <tr>
                        <td>成功</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>13123</td>
                        <td>131321</td>
                        <td>接通</td>
                        <td>下载文件</td>
                    </tr>
                </table>
                @if ($user['deal'] != [])
                    <p style=" text-align: left;margin-top:40px;">
                        <span class="qianyue">违规记录：</span><br>
                        @foreach ($user['deal'] as $record)
                            <span>{{$record['create_at']}} @if($record['deal_type'] != 100)停{{$record['deal_type']}}天 @else 永久停用 @endif 备注：{{$record['remark']}}</span><br>
                        @endforeach
                    </p>
                @endif
                <button type="button" class="btn_click" onclick=userRenew({{$user['id']}})>恢复账号</button>
                <button type="button" class="chuli btn_click" id="{{$user['id']}}">违约处理</button>
                <button type="button" onclick="termination(<?php echo e($user['id']); ?>)" class="zhuxiao btn_click">注销用户</button>
            </div>
            @endif
        </div>
    </div>
    {{--<script type="text/javascript" src="{{asset('/js/layui-v2.3.0/layui/layui.all.js')}}"></script>--}}
    <script type="text/javascript" src="{{asset('/js/user/Detailed_Information.js')}}"></script>
    <script>
        function termination(id) {
            layer.open({
                content:'您确定终止协议（注销用户）吗？',
                yes:function(){
                    $.get('http://' + HTTP_HOST + '/admin/terminationAgreement/' + id, function (data) {
                        layer.msg('修改成功!');
                    })
                }
            })
        }
        //恢复账号
        function userRenew(id){
            layer.open({
                content:'您确定恢复此账号吗？'
                ,yes: function(index, layero){
                    window.location.href="{{url('admin/userRenew')}}/"+id;
                }
            })
        }
    </script>
@endsection